import * as React from 'react'
import { render } from 'react-dom'
import { Provider } from 'react-redux'
import { createStore } from 'redux'
import { todoApp } from './reducers';
import { AppContainers } from './components/App';

let store = createStore(todoApp)

let el = document.createElement("div");
document.body.appendChild(el);
render(
    <Provider store={store}>
        <AppContainers />
    </Provider>,
    el
)


//添加监听
let unsubscribe = store.subscribe(() =>
    console.log(store.getState())
)

//取消监听
// unsubscribe();